
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 11/29/2012 18:43:41
-- Generated from EDMX file: C:\Users\Rob\Dropbox\Cochinita\CochinitaCorte\CochinitaCorteModel\CochinitaCorteModel.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[FK_VentasMasterVentasDetail]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[VentasDetails] DROP CONSTRAINT [FK_VentasMasterVentasDetail];
GO

-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[VentasMasters]', 'U') IS NOT NULL
    DROP TABLE [dbo].[VentasMasters];
GO
IF OBJECT_ID(N'[dbo].[VentasDetails]', 'U') IS NOT NULL
    DROP TABLE [dbo].[VentasDetails];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'VentasMasters'
CREATE TABLE [dbo].[VentasMasters] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [DateID] nvarchar(8000)  NOT NULL,
    [Date] datetime  NOT NULL,
    [col4] int  NOT NULL,
    [col5] int  NOT NULL,
    [col6] int  NOT NULL,
    [col7] int  NOT NULL,
    [col8] int  NOT NULL,
    [col9] int  NOT NULL,
    [col10] int  NOT NULL,
    [Cash] int  NOT NULL,
    [Dollars] int  NOT NULL,
    [ExchangeRate] int  NOT NULL,
    [CreditCard] int  NOT NULL,
    [col15] int  NOT NULL,
    [Total] int  NOT NULL,
    [Invoice] int  NOT NULL
);
GO

-- Creating table 'VentasDetails'
CREATE TABLE [dbo].[VentasDetails] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [ItemCount] int  NOT NULL,
    [col3] int  NOT NULL,
    [UnitPrice] int  NOT NULL,
    [ItemID] int  NOT NULL,
    [Date] datetime  NOT NULL,
    [col7] int  NOT NULL,
    [col8] int  NOT NULL,
    [col9] int  NOT NULL,
    [col10] int  NOT NULL,
    [col11] int  NOT NULL,
    [col12] int  NOT NULL,
    [col13] int  NOT NULL,
    [col14] int  NOT NULL,
    [col15] int  NOT NULL,
    [col16] int  NOT NULL,
    [DateID] int  NOT NULL,
    [Name] nvarchar(8000)  NOT NULL,
    [col19] int  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [Id] in table 'VentasMasters'
ALTER TABLE [dbo].[VentasMasters]
ADD CONSTRAINT [PK_VentasMasters]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'VentasDetails'
ALTER TABLE [dbo].[VentasDetails]
ADD CONSTRAINT [PK_VentasDetails]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------